#ifndef MWM_PROTO_H
#define MWM_PROTO_H

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "graphtypes.h"

/* pairs.c */
void PAIR (int *outcome);
void MERGE_PAIRS (int v);
void LINK_PATH (int e);
void INSERT_PAIR(void);

/* pointer.c */
void POINTER (int u,int v,int e);
void SCAN (int x, int del);

/* readgraph.c */
void SetMatrix(MatrixGraph graph);
void SetEuclid(EuclidGraph graph);
void SetStandard(Graph graph);
void SetUp (int gptr,int type);

/* glib.c */
Edge FindEdge(Graph graph,int i,int j);
int RemoveEdge(Graph graph,Edge edge);
int NumEdges(Graph g);
Graph NewGraph(int size);
EuclidGraph NewEuclid(int size);
MatrixGraph NewMatrix(int size);
Graph CopyGraph(Graph g);
Graph ReadB4Graph(int *size,char file[]);
Graph ReadGraph (int *size,char file[]);
void WriteGraph(Graph graph,char file[]);
EuclidGraph ReadEuclid(int *size,char file[]);
void WriteEuclid(EuclidGraph graph,char file[]);
MatrixGraph ReadMatrix(int *size,char file[]);
void WriteMatrix(MatrixGraph graph,char file[]);
int eucdist (EuclidGraph graph,int i,int j);
int eucdist2(EuclidGraph graph,int i,int j);
int eucdistsq(EuclidGraph graph,int i,int j);

/* term.c */
void SET_BOUNDS (void);
void UNPAIR_ALL (void);

/* unpairs.c */
void UNPAIR (int oldbase, int oldmate);
void REMATCH (int firstmate, int e);
void UNLINK (int oldbase);

/* wmatch.c */
int *Weighted_Match (int remain,int gptr,int type,int maximize);
void Initialize(int maximize);
void FreeUp(void);
#endif
